<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>无标题文档</title>
		<#include "/header.html">
			<link rel="stylesheet" href="/gaokao-admin/statics/css/zytb.css">
			<script src="/gaokao-admin/statics/libs/jquery.min.js"></script>
			<script src="/gaokao-admin/statics/libs/vue.js"></script>
			<script src="/gaokao-admin/statics/libs/FileSaver.js"></script>
			<script src="/gaokao-admin/statics/libs/jquery.wordexport.js"></script>
			<!-- 引入组件库 -->
			<script src="/gaokao-admin/statics/libs/zytb.js"></script>
			<script src="${request.contextPath}/statics/plugins/ztree/jquery.ztree.all.min.js"></script>
			<style>
				html {
					margin: 0;
					padding: 0;
				}
				
				body {
					font-family: "Microsoft Yahei";
					font-size: 12px;
					margin: 0;
					padding: 0;
					width: 100%;
					height: 100%;
				}
				
				ul {
					padding: 0;
					margin: 0;
				}
				
				ul li {
					list-style-type: none;
				}
				
				a {
					text-decoration: none;
				}
				
				a:hover {
					text-decoration: none;
					color: #f00;
				}
				
				.clear {
					clear: both;
					height: 0;
					overflow: hidden;
				}
				
				.htop {
					width: 720px;
					height: 30px;
					margin: 30px auto 0px;
					border-left: 1px solid #ccc;
					border-right: 1px solid #ccc;
				}
				
				.bt {
					width: 800px;
					height: 40px;
					margin: 0px auto;
				}
				
				.bt .zuo {
					width: 40px;
					height: 40px;
					border-top: 1px solid #ccc;
					float: left
				}
				
				.bt .zj {
					width: 718px;
					height: 40px;
					font-size: 18px;
					font-weight: bold;
					text-align: center;
					float: left
				}
				
				.bt .you {
					width: 40px;
					height: 40px;
					border-top: 1px solid #ccc;
					float: right
				}
				
				.htx {
					width: 720px;
					height: 60px;
					margin: 0px auto;
					font-size: 14px;
				}
				
				.htx p {
					height: 30px;
					margin: 0px auto;
					text-align: center;
				}
				
				.huizi {
					font-size: 12px;
					color: #ccc;
				}
				
				.lmain {
					width: 720px;
					height: auto;
					margin: 0px auto;
					margin-bottom: 20px;
				}
				/*.lmain .xxdh{ width:720px;; height:23px; font-size:14px; margin:0px; padding:0px; border-top:1px solid #000;  border-right:1px solid #000; border-bottom:0px; border-left:1px solid #000;border: 1px solid #0a0a0a;}*/
				/*.lmain table{ width:720px; border:solid #000; border-width:1px 0px 0px 1px;}*/
				/*.lmain td{ height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;}*/
				
				.cang {
					width: 720px;
					height: 500px;
					margin: 0px auto;
					position: relative;
					top: 5px;
					overflow-y: auto;
					overflow-x: hidden;
				}
				
				.cang .shai {
					width: 100%;
					height: 110px;
					background-color: #e7ebee;
				}
				
				.cang .shai .czuo {
					width: 322px;
					height: 90px;
					float: left;
					border-right: 1px solid #000;
					margin-top: 10px;
				}
				
				.cang .shai .czuo p {
					margin-top: 0px;
					margin-left: 5px;
					height: 10px;
					text-align: left;
					font-size: 14px
				}
				
				.cang .shai .cyou {
					width: 380px;
					height: 90px;
					float: left;
					margin-top: 10px;
				}
				
				.cang .shai .cyou p {
					margin-top: 0px;
					margin-left: 5px;
					height: 10px;
					text-align: left;
					font-size: 14px
				}
				
				.cang .xlist {
					width: 100%;
					height: 390px;
					margin: 0px auto;
				}
				
				.cang .xlist ul {
					margin: 0px;
					padding: 0px;
				}
				
				.cang .xlist ul li {
					width: 100%;
					min-height: 20px;
					height: 100%;
					border-bottom: 1px solid #ccc;
					line-height: 30px;
				}
				
				.cang .xlist ul li:hover {
					background-color: #CCC;
					cursor: pointer
				}
				
				.professionIndex {
					border-radius: 50%;
					height: 20px;
					width: 20px;
					display: inline-block;
					background: #238ff9;
					vertical-align: top;
				}
				
				#hxz {
					width: 40px;
					height: 40px;
					line-height: 40px;
					padding-top: 5px;
					margin: 0px;
					float: left;
					text-align: center
				}
				
				#hdh {
					width: 80px;
					height: 40px;
					padding-top: 5px;
					margin: 0px;
					float: left;
				}
				
				#hmc {
					width: 300px;
					min-height: 40px;
					text-align: center;
					line-height: 20px;
					margin: 0px;
					padding: 10px;
					float: left
				}
				
				#hzdf {
					width: 130px;
					height: 40px;
					padding-top: 5px;
					margin: 0px;
					padding-left: 10px;
					float: left
				}
				
				#hln {
					width: 80px;
					height: 20px;
					padding-top: 5px;
					margin: 0px;
					float: right
				}
				
				.seachSchool {
					color: #C00;
					cursor: pointer
				}
				
				.seachSchoolOut {
					cursor: pointer
				}
			</style>

	</head>

	<body>

		<!--<div><button onclick="printfDoc()">打印</button></div>-->
		<div class="grid-btn" style="margin:0 auto">
			<a class="btn btn-danger" onclick="location.reload()">清空表格</a>
			<a class="btn btn-primary" onclick="app.temapateDialog = true">存储为模板</a>
			<a class="btn btn-primary" id="upload" onclick="baobei()">报备并保存</a>
			<a class="btn btn-primary" onclick="save()">仅保存</a>
		</div>

		<div class="row">
			<div class="col-md-3">
				<h3>模板列表</h3>
				<div id="templateTree" class="ztree">

				</div>
			</div>
			<div class="col-md-8">
				<div id="app">
					<div id="printfWord">
						<div style="text-align: center">
							<div class="htop"></div>
							<div>{{teamplateName}} </div>
							<div class="bt">
								<div class="zuo"></div>
								<div class="zj">志愿填报计划书</div>
								<div class="you"></div>
							</div>

							<div class="htx" @click="setStudent = true">
								<p>{{student.name}}（{{student.card}}） 　{{student.wenlike}}　　<span style="font-size:16px">{{student.score}}分</span> 　　{{student.school}} 　　电话：{{student.phone}}</p>
								<p class="huizi">华赛大数据精准分析 {{user.phone}} {{user.username}}</p>
							</div>

							<div v-for="(item,index) in schools">
								<div class="lmain">
									<div @click="showSchool(item,index)">

										<table cellpadding="0" cellspacing="0" style="width:720px; border:solid #000; border-width:1px 0px 0px 1px;">
											<tr>
												<td colspan="6" style="border-bottom: 1px solid #000;border-right: 1px solid #000;height: 40px">
													平行志愿院校{{index+1}} 代号及名称
													<span style="font-weight:bold;">{{item.code}}　{{item.name}}</span>　　　 专业服从调剂：是
												</td>
											</tr>
											<tr>
												<td width="82" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业1代号</td>
												<td width="156" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业1名称</td>
												<td width="82" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业2代号</td>
												<td width="156" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业2名称</td>
												<td width="82" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业3代号</td>
												<td width="156" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业3名称</td>
											</tr>
											<tr>
												<td v-if="item.professions[0] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;text-align: center">{{item.professions[0].code}}</td>
												<td v-if="item.professions[0] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
												<td v-if="item.professions[0] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">{{item.professions[0].name}}</td>
												<td v-if="item.professions[0] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
												<td v-if="item.professions[1] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;text-align: center">{{item.professions[1].code}}</td>
												<td v-if="item.professions[1] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
												<td v-if="item.professions[1] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">{{item.professions[1].name}}</td>
												<td v-if="item.professions[1] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
												<td v-if="item.professions[2] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;text-align: center">{{item.professions[2].code}}</td>
												<td v-if="item.professions[2] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
												<td v-if="item.professions[2] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">{{item.professions[2].name}}</td>
												<td v-if="item.professions[2] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
											</tr>
											<tr>
												<td style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业4代号</td>
												<td style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业4名称</td>
												<td style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业5代号</td>
												<td style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业5名称</td>
												<td style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业6代号</td>
												<td style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">专业6名称</td>
											</tr>
											<tr>
												<td v-if="item.professions[3] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;text-align: center">{{item.professions[3].code}}</td>
												<td v-if="item.professions[3] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
												<td v-if="item.professions[3] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">{{item.professions[3].name}}</td>
												<td v-if="item.professions[3] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
												<td v-if="item.professions[4] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;text-align: center">{{item.professions[4].code}}</td>
												<td v-if="item.professions[4] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
												<td v-if="item.professions[4] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">{{item.professions[4].name}}</td>
												<td v-if="item.professions[4] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
												<td v-if="item.professions[5] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;text-align: center">{{item.professions[5].code}}</td>
												<td v-if="item.professions[5] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
												<td v-if="item.professions[5] != undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">{{item.professions[5].name}}</td>
												<td v-if="item.professions[5] == undefined" style="height:10px; border:solid #000; border-width:0px 1px 1px 0px; padding:10px 0px;">&nbsp;</td>
											</tr>
										</table>
									</div>
									<div class="cang" v-if="item.chooseSchool">

										<div v-show="item.showChooseSchoolSeach">
											<div class="shai" style="height: 40px;">
												<p style="font-size:16px; font-weight:bold; text-align:center; line-height:40px;"> 学校列表</p>
												<p style="cursor:pointer; padding-right:20px;text-align:right; position:relative; top:-40px; " @click="showSchool(item,index)">
													<img src="/gaokao-admin/statics/css/xx.png" width="20" height="16" />
													<!--点击关闭-->
												</p>
											</div>
											<div class="shai" style="height:150px;">

												<p style="font-size:16px; font-weight:bold; text-align:center;padding-top: 25px;"> 学校列表</p>
												<p style="text-align:left; padding-left:6px; font-size:14px;">所在区域：<span v-for="item in seachSchool.region" :class="[idRegion == item?'seachSchool':'seachSchoolOut']" @click="getProvinces(item)">　{{item}}</span></p>
												<p style="text-align:left; padding-left:6px; font-size:14px;">所在省份：<span v-for="item in seachSchool.province" :class="[idProvince == item?'seachSchool':'seachSchoolOut']" @click="getCities(item)">　{{item}}</span></p>
												<p style="text-align:left; padding-left:6px; font-size:14px;">所在城市：<span v-for="item in seachSchool.cities" :class="[idCity == item?'seachSchool':'seachSchoolOut']" @click="getUniversitys2ByCity(item)">　{{item}}</span></p>

											</div>
											<div class="shai">
												<div class="czuo">
													<p>学校性质：<span v-for="item in seachSchool.nature" :class="[idNature == item?'seachSchool':'seachSchoolOut']" @click="isActiveNature(item)">　{{item}}</span></p>

													<p>办学层次：<span v-for="item in seachSchool.level" :class="[idLevel == item?'seachSchool':'seachSchoolOut']" @click="isLevel(item)">　{{item}}</span></p>

													<!--<p>所在地区：<span v-for="item in seachSchool.area" :class="[idArea == item?'seachSchool':'seachSchoolOut']" @click="isArea(item)">　{{item}}</span></p>-->
												</div>
												<div class="cyou">
													<p>文理科:<span v-for="item in seachSchool.wenlike" :class="[idWenlike == item?'seachSchool':'seachSchoolOut']" @click="isWenlike(item)">　{{item}}</span></p>
													<p>院校分类:<span v-for="item in seachSchool.category" :class="[idCategory == item?'seachSchool':'seachSchoolOut']" @click="isCategory(item)">　{{item}}</span></p>
													<p>专业形式:<span v-for="item in seachSchool.learnType" :class="[idLearnType == item?'seachSchool':'seachSchoolOut']" @click="isLearnType(item)">　{{item}}</span></p>
												</div>
											</div>

											<div class="xlist">
												<ul>
													<li>
														<p id="hdh" style="font-weight:bold;font-size:16px;">学校代号</p>
														<p id="hmc" style="font-weight:bold;font-size:16px;">学校名称</p>
														<p id="hzdf" style="font-weight:bold;font-size:16px;">预估学校最低分</p>
														<p id="hln" style="font-weight:bold;font-size:16px;">历年参考</p>
														<p class="clear"></p>
													</li>
													<li v-for="(university,j) in universitys" @click="setUniversity(index,university)">
														<p id="hdh">{{university.code}}</p>
														<p id="hmc" style="font-size:16px;">{{university.name}}</p>
														<p id="hzdf">
															<span style="font-size:12px;color:#DF7401">{{idLevel}}</span>
															<span style="font-size:14px">{{university.predictor}}</span> {{idLearnType}}
															<span v-if="idWenlike == '理科'" style="color:#DF7401">理</span>
															<span v-else style="color:#088A08">文</span></p>
														<!--{{university.lastThreeYear}}-->
														<el-tooltip class="item" effect="dark" :content="university.lastThreeYear" placement="left">
															<p id="hln" @mouseover="getLastYear(university.id,j)">历年参考</p>
														</el-tooltip>
														<!--<p id="hln" @mouseover="getLastYear(university.id,j)">历年参考</p>-->

														<p class="clear"></p>
													</li>
												</ul>
											</div>
										</div>
										<div v-show="!item.showChooseSchoolSeach">
											<div class="cang">
												<div class="shai" style="height: 40px;">
													<p style="font-size:16px; font-weight:bold; text-align:center; line-height:40px;">{{item.code}}　{{item.name}} 专业列表</p>
													<span style="float:right;cursor:pointer; padding-right:20px;text-align:right; position:relative;top:-40px; " @click="showSchool(item,index)">
                                      <img src="/gaokao-admin/statics/css/xx.png" width="20" height="16" />
                                            <!--点击关闭-->
                                  </span>

													<span style="float:right;cursor:pointer; padding-right:20px;text-align:right; position:relative; top:-40px; " @click="item.showChooseSchoolSeach=true">
                                      <img src="/gaokao-admin/statics/css/back.png" width="20" height="16" />
                                            <!--点击收起-->
                                  </span>

												</div>

												<div class="xlist">
													<ul>
														<li>
															<p id="hxz" style="font-weight:bold;">选序</p>
															<p id="hxz" style="font-weight:bold;"></p>
															<p id="hdh" style="font-weight:bold;">专业代号</p>
															<p id="hmc" style="font-weight:bold;">专业名称</p>
															<p id="hzdf" style="font-weight:bold;">预估专业最低分</p>
															<p id="hln" style="font-weight:bold;">历年参考</p>
															<p class="clear"></p>
														</li>
														<li v-for="(profession,i) in professions">
															<p id="hxz">
																<span :class="[profession.index == null?'':'professionIndex']">
                        											<span style="display: block;    color: #FFFFFF;    height: 20px;    line-height: 20px;    text-align: center"> {{profession.index}}</span>
																</span>
															</p>
															<p id="hxz" @change="clickMe(i,profession,index)">
																<input :name="profession.id" type="checkbox" :value="profession.id" v-model="profession.ckeckVal" /></p>
															<p id="hdh">{{profession.code}}</p>
															<p id="hmc">{{profession.name}} </p>
															<p id="hzdf"><span style="font-size:16px">{{profession.predictor}}</span> {{idLearnType}}
																<span v-if="idWenlike == '理科'" style="color:#DF7401">理</span>
																<span v-else style="color:#088A08">文</span></p>
															</p>
															<p id="hln">历年参考</p>
															<p class="clear"></p>
														</li>
														<!--<li>-->
														<!--<p id="hxz">4</p>-->
														<!--<p id="hdh"><input name="" type="checkbox" value="" />A434</p>-->
														<!--<p id="hmc">汉语言文学</p>-->
														<!--<p id="hzdf"><span style="font-size:16px">510分</span> 普通 理</p>-->
														<!--<p id="hln">历年参考</p>-->
														<!--<p class="clear"></p>-->
														<!--</li>-->
													</ul>
												</div>
											</div>
										</div>
									</div>

								</div>
							</div>
						</div>

					</div>
					<el-dialog title="" :visible.sync="setStudent" width="30%">

						<el-row>
							<el-col :span="8"><span>姓名：</span></el-col>
							<el-col :span="16">
								<el-input v-model="student.name" placeholder="请输入姓名"></el-input>
							</el-col>
						</el-row>
						<br>
						<el-row>
							<el-col :span="8"><span>考号：</span></el-col>
							<el-col :span="16">
								<el-input v-model="student.card" placeholder="请输入考号"></el-input>
							</el-col>
						</el-row>
						<br>
						<el-row>
							<el-col :span="8"><span>所属高中：</span></el-col>
							<el-col :span="16">
								<el-input v-model="student.school" placeholder="请输入所属高中"></el-input>
							</el-col>
						</el-row>
						<br>
						<el-row>
							<el-col :span="8"><span>分数：</span></el-col>
							<el-col :span="16">
								<el-input v-model="student.score" placeholder="请输入分数"></el-input>
							</el-col>
						</el-row>
						<br>
						<el-row>
							<el-col :span="8"><span>文理科：</span></el-col>
							<el-col :span="16">
								<el-select v-model="student.wenlike" placeholder="请选择" @change="setIsWenLiKe()">
									<el-option v-for="item in wenlike" :key="item.name" :label="item.name" :value="item.name">
									</el-option>
								</el-select>
							</el-col>
						</el-row>
						<br>
						<el-row>
							<el-col :span="8"><span>手机：</span></el-col>
							<el-col :span="16">
								<el-input v-model="student.phone" placeholder="请输入手机号"></el-input>
							</el-col>
						</el-row>

						<span slot="footer" class="dialog-footer">
		    <!--<el-button @click="setStudent = false">取 消</el-button>-->
		    <el-button type="primary" @click="setStudent = false">确 定</el-button>
		  </span>
					</el-dialog>

					<el-dialog title="" :visible.sync="temapateDialog" width="30%">

						<el-row>
							<el-col :span="8"><span>模板名称：</span></el-col>
							<el-col :span="16">
								<el-input v-model="templateName" placeholder="请输入模板名称"></el-input>
							</el-col>
						</el-row>
						<br>

						<span slot="footer" class="dialog-footer">
					    <!--<el-button @click="setStudent = false">取 消</el-button>-->
					    <el-button type="primary" @click="saveTemplate()">确 定</el-button>
					     <el-button type="danger" @click="temapateDialog = false">取 消</el-button>
					  </span>
					</el-dialog>

				</div>

			</div>
			<div class="col-md-1">
				
			</div>
		</div>

	</body>

	<script>
		var templateSetting = {
			data: {
				simpleData: {
					enable: true,
					idKey: "id",
					pIdKey: "parentId",
					rootPId: -1
				},
				key: {
					url: "nourl"
				}
			},
			callback: {
				onClick: chooseTemplete
			}
		};
		var templateTree;

		function chooseTemplete(event, treeId, treeNode) {

			confirm('确定要导入此模板？', function() {
				$.ajax({
					type: "GET",
					url: baseURL + 'gaokaobaobei/userbackup/getTemplateById?id=' + treeNode.id,
					contentType: "application/json",
					success: function(r) {
						console.log(r)
						app.teamplateName = treeNode.name
						app.schools = r.schools
						alert("导入成功");

					}
				});
			});
		}

		$(function() {
			app.getTemplateTree()
		})

		function baobei() {
			if(app.student.name == null) {
				alert("姓名为空");
				return;
			}
			// if(app.student.card=="" )  {alert("证件号为空");return;}
			if(app.student.school == "") {
				alert("学校为空");
				return;
			}
			if(app.student.score == 0) {
				alert("分数未填");
				return;
			}
			if(app.student.wenlike == "") {
				alert("文理科未选");
				return;
			}
			if(app.student.phone == "") {
				alert("电话未填");
				return;
			}

			var d = {
				name: app.student.name,
				candidateNumber: app.student.card,
				wlProperty: app.student.wenlike,
				score: app.student.score,
				highSchool: app.student.school,
				universitys: app.schools,
				phone: app.student.phone,
				admissionstype: '夏考',
				isDesign: 1
			}
			//   printfDoc()
			$.ajax({
				type: "POST",
				url: baseURL + 'gaokaobaobei/userbackup/baobeiStudent',
				contentType: "application/json",
				data: JSON.stringify(d),
				success: function(r) {
					if(r.code == 0)
						alert("报备成功")
					else if(r.code == 101)
						alert("此人已经报备过了")
					else
						alert("报备失败")
				}
			});
		}

		function save() {
			if(app.student.name == null) {
				alert("姓名为空");
				return;
			}
			// if(app.student.card=="" )  {alert("证件号为空");return;}
			if(app.student.school == "") {
				alert("学校为空");
				return;
			}
			if(app.student.score == 0) {
				alert("分数未填");
				return;
			}
			if(app.student.wenlike == "") {
				alert("文理科未选");
				return;
			}
			if(app.student.phone == "") {
				alert("电话未填");
				return;
			}

			var d = {
				name: app.student.name,
				candidateNumber: app.student.card,
				wlProperty: app.student.wenlike,
				score: app.student.score,
				highSchool: app.student.school,
				universitys: app.schools,
				phone: app.student.phone,
				isDesign: 1
			}
			//   printfDoc()
			$.ajax({
				type: "POST",
				url: baseURL + 'gaokaobaobei/userbackup/baobeiStudent',
				contentType: "application/json",
				data: JSON.stringify(d),
				success: function(r) {
					if(r.code == 0)
						alert("保存成功")
					else if(r.code == 101)
						alert("此人已经保存过了")
					else
						alert("保存失败")
				}
			});
		}

		function printfDoc() {
			for(let i = 0; i < app.schools.length; i++) {
				app.schools[i].chooseSchool = false
			}
			setTimeout(function() {
				$("#printfWord").wordExport(app.student.name + app.student.score + app.student.wenlike)
			}, 1000)
		}

		var app = new Vue({
			el: '#app',
			data() {
				return {
					teamplateName: null,
					temapateDialog: false,
					templateName: "",
					ckeckVal: "没点我",
					seachSchool: {
						nature: ['公办', '民办', '独立学院', '混合所有制'],
						level: ["本科", "专科"],
						category: ["普通", "医学类", "师范类", "艺术类", "军警体"],
						area: ["全部", "济南", "沿海", "鲁中", "鲁西南", "鲁西北"],
						wenlike: ["理科", "文科"],
						learnType: ["普通", "校企合作", "中外合作", "3+2连读", "春考", "艺术"],
						region: ['全部', '华北', '华东', '华中', '华南', '西南', '西北', '东北'],
						province: [],
						cities: []
					},
					idNature: "公办",
					idLevel: "本科",
					idCategory: "普通",
					idArea: "全部",
					idWenlike: "理科",
					idLearnType: "普通",
					setStudent: true,
					chooseIndex: 0,
					user: {},
					student: {
						name: null,
						card: "",
						school: "",
						score: 0,
						wenlike: "",
						phone: ""
					},
					wenlike: [{
						name: "文科"
					}, {
						name: "理科"
					}],
					schools: [{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
						{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
						{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
						{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
						{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
						{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
						{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
						{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
						{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
						{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
						{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
						{
							name: "",
							isDispensing: true,
							professions: [],
							chooseSchool: false,
							button: "关闭",
							showChooseSchoolSeach: true,
						},
					],
					universitys: [{
						id: 1,
						code: "A2A2",
						name: "山东科技大学",
						predictor: 510.5,

					}],
					professions: [{
						id: 1,
						code: "A2A2",
						name: "无脊椎动物语言学",
						predictor: 510.5,

					}]
				}
			},
			methods: {
				saveTemplate() {

					var d = {
						name: app.templateName,
						universitys: app.schools,
					}
					$.ajax({
						type: "POST",
						url: baseURL + 'gaokaobaobei/userbackup/saveTemplate',
						contentType: "application/json",
						data: JSON.stringify(d),
						success: function(r) {
							app.getTemplateTree()
							app.temapateDialog = false
							if(r.code == 0) {
								alert("保存成功")
							} else {
								alert("保存失败 ")
							}
						}
					});
				},
				getProvinces(item) {
					let name = {
						'name': item
					}
					app.idRegion = item
					$.ajax({
						type: "POST",
						url: baseURL + 'school/provinceAndCities/getProvinces',
						contentType: "application/json",
						data: JSON.stringify(name),
						success: function(r) {
							app.seachSchool.province = []
							app.seachSchool.cities = []
							app.seachSchool.province.push("全部")
							app.idProvince = "全部"
							for(let i = 0; i < r.data.length; i++) {
								app.seachSchool.province.push(r.data[i].name)
							}
							app.getUniversitys2()
						}
					});
				},
				getCities(item) {
					let name = {
						'name': item
					}
					app.idProvince = item
					$.ajax({
						type: "POST",
						url: baseURL + 'school/provinceAndCities/getCities',
						contentType: "application/json",
						data: JSON.stringify(name),
						success: function(r) {
							app.seachSchool.cities = r.data
							app.seachSchool.cities.unshift("全部")
							app.idCity = "全部"
							app.getUniversitys2()
						}
					});

				},
				getUniversitys2ByCity(item) {
					app.idCity = item
					app.getUniversitys2()
				},
				getTemplateTree() {
					//加载学校树
					$.get(baseURL + "gaokaobaobei/userbackup/getTemplatelTree?username=" + localStorage.username, function(r) {
						templateTree = $.fn.zTree.init($("#templateTree"), templateSetting, r.templatelTree);
						var node = templateTree.getNodeByParam("id", 0);
						templateTree.selectNode(node);
					})
				},
				getLastYear(id, index) {
					var search = {
						id: id,
						idWenlike: this.idWenlike,
						idLearnType: this.idLearnType,
						idLevel: this.idLevel
					}
					if(app.universitys[index].lastThreeYear == null) {
						$.ajax({
							type: "POST",
							url: baseURL + '/school/school/getLastYearScore',
							contentType: "application/json",
							data: JSON.stringify(search),
							success: function(r) {
								app.universitys[index].lastThreeYear = r.lastThreeYear
								console.log(r)
							}
						});
					}
				},
				clickMe(pindex, profession, index) {
					if(this.schools[index].professions.length >= 6 && profession.ckeckVal == true) {
						this.professions[pindex].ckeckVal = false
						alert("超过了6个专业")
					} else {
						let sp = []
						//找到所有被选中的专业
						for(let i = 0; i < this.professions.length; i++) {
							if(this.professions[i].ckeckVal == true) {
								let a = {
									id: this.professions[i].id,
									code: this.professions[i].code,
									name: this.professions[i].name,
									predictor: this.professions[i].predictor,
									index: this.professions[i].index
								}
								sp.push(a)
							}
						}
						//设置专业顺序
						if(sp.length > this.schools[index].professions.length) {
							for(let i = 0; i < this.professions.length; i++) {
								if(this.professions[i].id == profession.id) {
									this.professions[i].index = sp.length
								}
							}
						} else {
							for(let i = 0; i < this.professions.length; i++) {
								if(this.professions[i].id == profession.id) {
									this.professions[i].index = null
								}
								if(this.professions[i].index > profession.index) {
									this.professions[i].index = this.professions[i].index - 1
								}
							}

						}

						this.schools[index].professions = []
						for(let i = 0; i < sp.length; i++) {
							for(let j = 0; j < this.professions.length; j++) {
								if(this.professions[j].index == (i + 1)) {
									let a = {
										id: this.professions[j].id,
										code: this.professions[j].code,
										name: this.professions[j].name,
										predictor: this.professions[j].predictor,
										index: this.professions[j].index
									}
									this.schools[index].professions.push(a)
								}
							}
						}
					}
				},
				showSchool(val, index) {
					console.log(val)
					console.log(index)
					this.chooseIndex = index
					if(this.schools[index].chooseSchool == false) {
						this.schools[index].chooseSchool = true
						this.schools[index].professions = []
					} else {
						this.schools[index].chooseSchool = false

					}
					for(let i = 0; i < this.schools.length; i++) {
						if(i != index)
							this.schools[i].chooseSchool = false
						this.schools[i].showChooseSchoolSeach = true
					}
				},
				isActiveNature(item) {
					console.log(item)
					this.idNature = item
					this.getUniversitys2()
				},
				isLevel(item) {
					console.log(item)
					this.idLevel = item
					this.getUniversitys2()
				},
				isCategory(item) {
					console.log(item)
					this.idCategory = item
					this.getUniversitys2()
				},
				isArea(item) {
					console.log(item)
					this.idArea = item
					this.getUniversitys2()
				},
				isWenlike(item) {
					console.log(item)
					this.idWenlike = item
					this.student.wenlike = this.idWenlike
					this.getUniversitys2()
				},
				setIsWenLiKe(){
					this.idWenlike = this.student.wenlike
					this.getUniversitys2()
				},
				isLearnType(item) {
					console.log(item)
					this.idLearnType = item
					this.getUniversitys2()
				},
				// getUniversitys() {
				// 	var search = {
				// 		idNature: this.idNature,
				// 		idLevel: this.idLevel,
				// 		idCategory: this.idCategory,
				// 		idArea: this.idArea,
				// 		idWenlike: this.idWenlike,
				// 		idLearnType: this.idLearnType,
				// 		province: '山东'
				// 	}
				// 	$.ajax({
				// 		type: "POST",
				// 		url: baseURL + '/school/school/getUniversitys',
				// 		contentType: "application/json",
				// 		data: JSON.stringify(search),
				// 		success: function(r) {
				// 			app.universitys = r.universitys
				// 			console.log(r)
				// 		}
				// 	});
				// },
				getUniversitys2() {
					var search = {
						idNature: this.idNature,
						idLevel: this.idLevel,
						idArea: "全部",
						idCategory: this.idCategory,
						idWenlike: this.idWenlike,
						idLearnType: this.idLearnType,
						region: this.idRegion,
						province: this.idProvince,
						cities: this.idCity
					}
					$.ajax({
						type: "POST",
						url: baseURL + '/school/school/getUniversitys',
						contentType: "application/json",
						data: JSON.stringify(search),
						success: function(r) {
							app.universitys = r.universitys
							console.log(r)
						}
					});
				},
				setUniversity(index, university) {
					this.schools[index].showChooseSchoolSeach = false
					this.schools[index].code = university.code
					this.schools[index].name = university.name
					this.schools[index].id = university.id
					console.log(university.id)
					this.getProfessions(university.id)
				},
				getProfessions(id) {
					var search = {
						schoolId: id,
						wenlike: this.idWenlike,
						learnType: this.idLearnType,
						level: this.idLevel

					}
					$.ajax({
						type: "POST",
						url: baseURL + '/school/profession/getProfessions',
						contentType: "application/json",
						data: JSON.stringify(search),
						success: function(r) {
							app.professions = r.professions
							console.log(r)
						}
					});
				}
			},
			mounted() {
				this.user.username = localStorage.getItem("username")
				this.user.phone = localStorage.getItem("phone")

				this.getUniversitys2()
			}
		})
	</script>

</html>